<div class="row">
	<div class="col-md-4">
		<h4><i class="fa fa-plus-circle"></i>&nbsp; {$title}</h4>
		<div class="tbl-ttl fuf-shadow"><i class="fa fa-plus-circle"></i>&nbsp;Tambah {$title}</div>
		<div class="bg-white tbl-td fuf-shadow">
			<form name="tag" action="tag.php?action=save" method="POST">
				<h5><strong>Judul Tag</strong></h5>
				<input type="text" class="fuf-input form-control" name="jdl_tag" placeholder="Judul Tag" />
				<span class="uk-9"><i class="fa fa-question-circle"></i>&nbsp;Judul yang akan tampil di web kamu</span>
				<h5><strong>Slug</strong></h5>
				<input type="text" class="fuf-input form-control" name="slug_tag" placeholder="Slug Tag" />
				<span class="uk-9"><i class="fa fa-question-circle"></i>&nbsp;Slug adalah url-ramah dari judul kategori.</span>
				<h5><strong>Deskripsi</strong></h5>
				<textarea class="fuf-input form-control" rows="3"name="deskripsi_tag" placeholder="Deskripsi Tag"></textarea>
				<span class="uk-9"><i class="fa fa-question-circle"></i>&nbsp;Penjelasan tentang Judul Kategori. Tidak di tampilkan pada halaman web.</span>
				<button type="submit" class="btn btn-primary bts-ats"><i class="fa fa-plus-circle"></i>&nbsp;Tambah</button>
			</form>
		</div>
	</div>
	<div class="col-md-8">
		<h4><i class="fa fa-tasks"></i>&nbsp;List {$title}</h4>
		<div class="tbl-ttl fuf-shadow">
			<div class="kiri fuf-tbl-25">Judul</div>
			<div class="kiri fuf-tbl-30">Deskripsi</div>
			<div class="kiri fuf-tbl-25">Slug</div>
			<div class="kiri fuf-tbl-10 fuf-center"><i class="fa fa-inbox"></i></div>
			<div class="kiri fuf-tbl-10 fuf-center"><i class="fa fa-wrench"></i></div>
			<div class="sambungfloat"></div>
		</div>
		{foreach from=$tag item=s}
		<div class=" bg-white tbl-td fuf-shadow">
			<div class="kiri fuf-tbl-25"><b>{$s.jdl_tag}</b></div>
			<div class="kiri fuf-tbl-30">{$s.deskripsi_tag}</div>
			<div class="kiri fuf-tbl-25">{$s.slug_tag}</div>
			<div class="kiri fuf-tbl-10 fuf-center">{$s.jumlah_tag}</div>
			<div class="kiri fuf-tbl-5 fuf-center"><a href="#edit" data-toggle="modal" data-id="{$s.id_tag}" class="edit"><i class="fa fa-edit logo" data-toggle="tooltip" data-placement="bottom" title="Edit"></i></a></div>
			<div class="kiri fuf-tbl-5 fuf-center"><a href="tag.php?action=delete&id={$s.id_tag}"><i class="fa fa-trash-o logo" data-toggle="tooltip" data-placement="bottom" title="hapus"></i></a></div>
			<div class="sambungfloat"></div>
		</div>
		{/foreach}
		<div class="alert alert-warning bts-ats fuf-shadow" role="alert">
			<span><i class="fa fa-exclamation-circle"></i>&nbsp; Tags can be selectively converted to categories using the tag to category converter.<br/>
			</span>
		</div>
	</div>
</div>
<div class="modal fade bs-example-modal-sm" id="edit" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h3><i class="fa fa-edit"></i> Edit {$title} : </h3>
			</div>
			<div class="modal-body">
				<form action="tag.php?action=edit" method="POST">
					<h5><strong>Judul</strong></h5>
					<input type="hidden" name="idtag" class="idtag">
					<input type="text" class="fuf-input form-control judul" name="jdl_tag" placeholder="Judul Tag" />
					<span class="uk-9"><i class="fa fa-question-circle"></i>&nbsp;Judul yang akan tampil di web kamu</span>
					<h5><strong>Slug</strong></h5>
					<input type="text" class="fuf-input form-control slug" name="slug_tag" placeholder="Slug Tag" />
					<span class="uk-9"><i class="fa fa-question-circle"></i>&nbsp;Slug adalah url-ramah dari judul kategori.</span>
					<h5><strong>Deskripsi</strong></h5>
					<textarea class="fuf-input form-control desc" rows="3"name="deskripsi_tag" placeholder="Deskripsi Tag"></textarea>
					<span class="uk-9"><i class="fa fa-question-circle"></i>&nbsp;Penjelasan tentang Judul Kategori. Tidak di tampilkan pada halaman web.</span><br/>
			</div>
			<div class="modal-footer">
				<button type="submit" class="btn btn-primary kanan">Simpan</button>
				</form>
			</div>	
		</div>
	</div>
</div>
{literal}
<script type="text/javascript">
	$(document).ready(function() {
		$('.edit').click(function(event) {
			var id = $(this).data("id");
			$.ajax({
				url: 'tag.php',
				type: 'GET',
				dataType: 'JSON',
				data: {action: 'getajax', id_tag:id}
			})
			.done(function(msg) {
				$('.judul').val(msg.jdl_tag);
				$('.desc').val(msg.deskripsi_tag);
				$('.slug').val(msg.slug_tag);
				$('.idtag').val(msg.id_tag);

			})
			.fail(function() {
				alert("");
			})
			.always(function() {
				console.log("complete");
			});
		});
	});
	$(document).ready(function(){
		$('.logo').tooltip();
	});
</script>
{/literal}